package com.lzw.cpvideoplayer.mvp.view;

import android.os.Bundle;

import com.lzw.cpvideoplayer.mvp.model.IModel;
import com.lzw.cpvideoplayer.mvp.presenter.BaseVideoPresenter;
import com.lzw.cpvideoplayer.mvp.presenter.VideoPresenter;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public abstract class BaseActivity<V extends IBaseView,P extends VideoPresenter> extends AppCompatActivity {
    public P presenter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        presenter = createPresenter();
        presenter.onAction((V)this);
    }

    public abstract P createPresenter();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        presenter.onDetion();
    }
}
